<?=$header?>
<body>
    <?=$navigate?>
    <!-- MAIN CONTENT -->
    <div id="content">
        <script>
        
                        $(function() {
                            <?php
                                $lastweek = time()-604800;
                            ?>
                            $('#datestart').datetimepicker({value:'<?=date('Y/m/d H:i',$lastweek);?>',step:10});
                            $('#dateend').datetimepicker({value:'<?=date('Y/m/d H:i');?>',step:10});
                            
                            $("#staff").autocomplete("<?=$this->config->item('main_url').'/report/jsearchname/'?>", {
                                width: 160,
                                autoFill: true,
                                selectFirst: true
                            });
                            
                            $("#salary").autocomplete("<?=$this->config->item('main_url').'/report/jsearchpaygrade/'?>", {
                                width: 160,
                                autoFill: true,
                                selectFirst: true
                            });
                        })
                    
                $.validator.setDefaults({
                    submitHandler: function() { 
                        staff = $('#staff').val();                     
                        datestart = $('#datestart').val();
                        dateend = $('#dateend').val();
                        salary = $('#salary').val();
                        
                        url = "<?=$this->config->item('main_url').'/report/print_summary/?'?>";
                        window.open(url+"datestart="+datestart+"&dateend="+dateend+"&key="+1,"myNewWinsr","width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no,scrollbars=yes"); 
                    }
                });    
                $(document).ready(function() {
                        $("#kform").validate({
                                rules: {
                                    /*bill_no: {
                                        required: true,
                                        minlength: 3,
                                        maxlength: 200
                                    },*/
                                    
                                    datestart: {
                                        required: true,                 
                                    },
                                    dateend: {
                                        required: true,                 
                                    }
                                },
                                messages: {
                                    /*bill_no: {
                                        required: "Please Enter Bill Number",
                                                            minlength: "Bill Number must consist of at least 3 characters"
                                    },*/
                                    
                                    datestart: {
                                        required: "Please Enter Date start"             
                                    },
                                    dateend: {
                                        required: "Please Enter Date end"               
                                    }
                                    
                                }
                            });
                      })
        </script>
        <div class="page-full-width cf">

            <?=$sidebarleft?>
            
            <div class="side-content fr">
            
                
                <div class="content-module">
                
                    <div class="content-module-heading cf">
                    
                        <h3 class="fl"><?=$title_page?></h3>
                        <span class="fr expand-collapse-text">Click to collapse</span>
                        <span class="fr expand-collapse-text initial-expand">Click to expand</span>
                    
                    </div> <!-- end content-module-heading -->
                    
                    
                    <div class="content-module-main cf">
                 
                        <div class="half-size-column fl">
                        
                            <?php echo form_open('report/summary', array('name'=>'kform','id'=>'kform','method'=>'POST','target'=>'_blank')); ?>
                             
                                <fieldset>
                                    <p> 
                                        <label for="simple-input">date start</label>
                                        <input type="text" id="datestart" name="datestart" class="round default-width-input" />
                                        <em></em>
                                    </p>

                                    <p>
                                        <label for="simple-input">date end</label>
                                        <input type="text" id="dateend" name="dateend" class="round default-width-input" />
                                        <em></em>
                                    </p>
                                    
                                    <input type="submit" value="View" name="submit" class="round blue ic-right-arrow" />
                                </fieldset>
                            
                            </form>
                        
                        </div> <!-- end half-size-column -->
                
                    </div> <!-- end content-module-main -->
                    
                </div> <!-- end content-module -->
    
            </div> <!-- end side-content -->
        
        </div> <!-- end full-width -->
            
    </div> 
    <!-- end content -->
    
    
    
    <!-- FOOTER -->
    <?=$footer?>
    <!-- end footer -->

</body>
</html>